package com.example.web.ui.tag.html.listener;

import com.example.common.utils.SpringContextHolder;
import com.example.web.ui.tag.html.manager.HtmlComponentManager;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

public class HtmlComponentInitListener implements ApplicationListener<ContextRefreshedEvent> {
    protected HtmlComponentManager htmlComponentManager = SpringContextHolder.getApplicationContext()
            .getBean(HtmlComponentManager.class);

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        try {
            htmlComponentManager.init();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}